gdk: Add GDK_WINDOW_STATE_FOCUSED to GdkWindowState
authorRui Matos <tiagomatos@gmail.com>
Fri, 28 Oct 2011 22:21:04 +0000 (23:21 +0100)
committerRui Matos <tiagomatos@gmail.com>
Tue, 8 Nov 2011 19:25:51 +0000 (19:25 +0000)
This state means that the toplevel window is presented as focused to the user,
i.e with active decorations under an X11 window manager.

If the GDK backend doesn't implement this flag, it will just remain set after
mapping the window.

https://bugzilla.gnome.org/show_bug.cgi?id=661428

gdk/gdkevents.h
gdk/gdkwindow.c

index 24a3b8ea4b19f0fd6dadc5d3152506fef1b1601b..a1baac1d75a7bd7991c19e25b553d0295f7863a2 100644 (file)
@@ -371,6 +371,7 @@ typedef enum
  *   decorations.
  * @GDK_WINDOW_STATE_ABOVE: the window is kept above other windows.
  * @GDK_WINDOW_STATE_BELOW: the window is kept below other windows.
+ * @GDK_WINDOW_STATE_FOCUSED: the window is presented as focused (with active decorations).
  *
  * Specifies the state of a toplevel window.
  */
@@ -382,7 +383,8 @@ typedef enum
   GDK_WINDOW_STATE_STICKY     = 1 << 3,
   GDK_WINDOW_STATE_FULLSCREEN = 1 << 4,
   GDK_WINDOW_STATE_ABOVE      = 1 << 5,
-  GDK_WINDOW_STATE_BELOW      = 1 << 6
+  GDK_WINDOW_STATE_BELOW      = 1 << 6,
+  GDK_WINDOW_STATE_FOCUSED    = 1 << 7
 } GdkWindowState;
 
 /**
index e2966e2129e212519e99eeb7a2c4ea5ba93574d3..e47b7f26670b82631fb32f591bd53bea33d2bbff 100644 (file)
@@ -5184,7 +5184,7 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise)
       if (!was_mapped)
        gdk_synthesize_window_state (window,
                                     GDK_WINDOW_STATE_WITHDRAWN,
-                                    0);
+                                    GDK_WINDOW_STATE_FOCUSED);
     }
   else
     {